/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ruteodosciudades;

import java.awt.Event;
import java.awt.GridLayout;
import java.awt.Panel;
import javax.swing.JComboBox;
import javax.swing.JLabel;

/**
 *
 * @author markos
 */
public class DocOptions extends Panel {

    private JComboBox doc = new JComboBox();
    private Documentacion parent;

    public DocOptions(Documentacion myparent) {
        setLayout(new GridLayout(2, 1, 5, 0));
        parent = myparent;
        add(new JLabel("DOCUMENTACION:"));
        doc.addItem("Dibujar nodos");
        doc.addItem("Remover nodos");
        doc.addItem("Mover nodos");
        doc.addItem("Nodo inicial");
        doc.addItem("Dibujar aristas");
        doc.addItem("Cambiar pesos");
        doc.addItem("Remover aristas");
        doc.addItem("Reiniciar");
        doc.addItem("Ejecutar algoritmo");
        doc.addItem("Pasar");
        doc.addItem("Ejemplo");
        doc.addItem("Salir");
        doc.addItem("Referencia");
        add(doc);
    }

    @Override
    public boolean action(Event evt, Object arg) {
        if (evt.target instanceof JComboBox) {
            String str = doc.getSelectedItem().toString();
            parent.getDoctext().showline(str);
        }
        return true;
    }
}
